<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			var arr = [18,45,333,5,6,1,5];
			sum(arr);
			
			
			function sum(arr){
				var sum = 0;
				for (var i = 0; i < arr.length; i++) {
					sum+=arr[i];
				}
				
				console.log(sum);
			}
			
			
		</script>
	</body>
</html>
